% Matlab Programs for results in "Moentary Policy Regime Shifts and Inflation Persistencet" 
% 
% Taeyoung Doh : July , 23, 2014 
% If you have any question regarding the implementaion of matlab codes, please send an e-mail to taeyoung.doh@kc.frb.org (or dohtyoung@gmail.com) 


% Run programs in the following order 

1. 2mp2v (4 regime model) 

- rsmodel_spec.m in model folder: determine the dataset and other specifications for the DSGE model to be estimated. 

- rstsmhrun0.m : generate 100K prior draws 

- rsts_stat0.m : use 100K prior draws to compute statistics from the prior distribution  

- rsts_start.m : find a starting point for a MCMC chain by maximizing the posterior density 

- rsmhrunpm.m  : generate 1 million posterior draws used to update the scaling matrix in the RWMH algorithm

- rsts_stat.m  : compute the covariance matrix from 1 million posterior draws to update the scaling matrix 
                  (output saved in the file starting with 'stat_mhrunch01.mat')   
                  
- rsts_mhrunpm.m : generate 1.5 million posterior draws for posterior inference                  
                  [the output from rsmhrunpm.m is overwritten!] 
                  
- rsts_stat2.m :  burn the first 100k draws and use the remaining 1400K draws for inference 
output saved in the file 'stat_mhrunch11.mat' 

- SWZmdd.m : compute marginal data density using Sims et al. (2008) method   

- vardecomposition.m : variance decomposition 

- wplot.m : weight on the most persistent shock 

- wtransplot.m : inflation persistence as a function of policy parameter for different volatility regimes

2. 2v (2 volatility regime model) 
- in the last step, generate 2 million draws and burn in the first 100K draws and use the remaining 1.9 million draws for posterior inference

3. 2mp (2 monetary policy regime model) 
- in the last step, generate 1 million draws and burn in the fist 500K draws and use the remaining 500k draws for posterior inference 
4. 1mp1v (no regime switching) 



